<?php
namespace Common\Model;
use Common\Model\CommonModel;
class BannerModel extends CommonModel{
    //自动验证
    protected $_validate = array(
        //array(验证字段,验证规则,错误提示,验证条件,附加规则,验证时间)
        array('image', 'require', 'Banner图片不能为空！', 1, 'regex', 3),
        array("cook_id","/^[0-9]*[1-9][0-9]*$/","链接地址应为大于1的整数"),
    );

    protected function _before_write(&$data) {
        parent::_before_write($data);
    }
}